from django.contrib import admin
from .models import Category, Blog


@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
    list_display = ('name', )
    list_per_page = 50


@admin.register(Blog)
class BlogAdmin(admin.ModelAdmin):
    list_display = ('pk', 'title', 'category', 'author', 'create_time', 'update_time')
    list_per_page = 20
    search_fields = ('title', )
    list_filter = ('author', 'category')
